#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
int a[N];
int b[N];
ll f1() {
  int c[2] = {0};
  ll sum = 0;
  per(i, n, 1) {
    if (b[i]) swap(c[0], c[1]);
    sum += c[1];
    c[b[i]]++;
    sum += c[1];
  }
  return sum;
}
ll f2() {
  int c[2] = {0};
  ll sum = 0;
  per(i, n, 1) {
    if (!b[i]) c[0] += c[1], c[1] = 0;
    sum += c[1];
    c[b[i]]++;
    sum += c[1];
  }
  return sum;
}
ll f3() {
  int c[2] = {0};
  ll sum = 0;
  per(i, n, 1) {
    if (b[i]) c[1] += c[0], c[0] = 0;
    sum += c[1];
    c[b[i]]++;
    sum += c[1];
  }
  return sum;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  rep(i, 1, n) cin >> a[i];
  ll sum1 = 0, sum2 = 0, sum3 = 0;
  rep(j, 0, 29) {
    rep(i, 1, n) b[i] = a[i] >> j & 1;
    sum1 += f1() << j;
    sum2 += f2() << j;
    sum3 += f3() << j;
  }
  double x = 1.0 * n * n;
  cout << fixed << setprecision(3) << sum1 / x << ' ' << sum2 / x << ' '
       << sum3 / x;
  return 0;
}